home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 June
/
EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso
/
earcd
/
comm2
/
crshtk10.lha
/
CrashTick
/
TickStatsFormat.doc
< prev
next >
Wrap
Text File
|
1996-05-08
|
9KB
|
186 lines
CrashTick Statistics file format 1.0
08-May-96
Introduction
============
In this file, the format of CrashTick's statistics file is described.
With this text and a little programming knowledge, you can easily make
your own programs that use the statistics file.
There are two basic rules that you should obey:
1) Do NOT alter the file!
2) If the file isn't in the expected format, warn the user and
quit the program nicely.
File format
===========
Basic file format
-----------------
+---------+--------------------------------------------------------+
| Size | Description |
+---------+--------------------------------------------------------+
| 4 bytes | Always the string "CTS1". These four characters tell |
| | you what kind of file it is. If the these four |
| | characters aren't "CTS1", your program should give an |
| | error and quit nicely. |
+---------+--------------------------------------------------------+
| 4 bytes | A longword that contains the day the statistics file |
| | was written. This is stored as days since Jan. 1, 1978 |
| | which is the same way AmigaDOS stores the date in |
| | datestamps . |
+---------+--------------------------------------------------------+
| 4 bytes | A longword that tells you how many areas there are in |
| | this file. |
+---------+--------------------------------------------------------+
| ??? | The statistics for the areas. The format of these |
| | sections are described below. There are as many |
| | structures as specified with the previous four bytes. |
+---------+--------------------------------------------------------+
| 4 bytes | A longword that tells you how many nodes there are in |
| | this file. |
+---------+--------------------------------------------------------+
| ??? | The statistics for the nodes. The format of these |
| | sections are described below. There are as many |
| | structures as specified with the previous four bytes. |
+---------+--------------------------------------------------------+
Area statistics format
----------------------
+-----------+--------------------------------------------------------+
| Size | Description |
+-----------+--------------------------------------------------------+
| 80 bytes | The name of the area |
+-----------+--------------------------------------------------------+
| 2 bytes | A word that contains the zone number of the aka |
+-----------+--------------------------------------------------------+
| 2 bytes | A word that contains the net number of the aka |
+-----------+--------------------------------------------------------+
| 2 bytes | A word that contains the node number of the aka |
+-----------+--------------------------------------------------------+
| 2 bytes | A word that contains the point number of the aka |
+-----------+--------------------------------------------------------+
| 1 byte | The group of the area ("A"-"Z") or zero if no group |
| | is specified for this areas. |
+-----------+--------------------------------------------------------+
| 1 byte | Not used. This byte exists to make sure that the next |
| | item is on an even offset in the file to make it |
| | easier to read this file when programming in C |
+-----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the total number of __files__ |
| | you have received in this area. |
+-----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the total number of __bytes__ |
| | you have received in this area. |
+-----------+--------------------------------------------------------+
| 8*4 bytes | 8 longwords that contain the number of __files__ that |
| | have arrived in this area for the last 8 days. The |
| | first word contains the number of messages that had |
| | arrived so far the day the file was written, the |
| | second word contains the number of messages that had |
| | arrived the day before that etc. |
+-----------+--------------------------------------------------------+
| 8*4 bytes | 8 longwords that contain the number of __bytes__ that |
| | have arrived in this area for the last 8 days. The |
| | first word contains the number of messages that had |
| | arrived so far the day the file was written, the |
| | second word contains the number of messages that had |
| | arrived the day before that etc. |
+-----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the day since Jan. 1, 1978 |
| | that you first received messages in this area. |
+-----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the minutes since midnight |
| | the first time you received messages in this area. |
+-----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the "ticks" (50 ticks are |
| | one second) since the last whole minute the first time |
| | you received messages in this area. The three last |
| | fields together are a normal AmigaDOS datestamp. |
+-----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the last date you received |
| | messages in this area. This is stored as days since |
| | Jan. 1, 1978 which is the same way AmigaDOS stores the |
| | date in datestamps. |
+-----------+--------------------------------------------------------+
Node statistics format
----------------------
+----------+--------------------------------------------------------+
| Size | Description |
+----------+--------------------------------------------------------+
| 2 bytes | A word that contains the zone number of the node |
+----------+--------------------------------------------------------+
| 2 bytes | A word that contains the net number of the node |
+----------+--------------------------------------------------------+
| 2 bytes | A word that contains the node number of the node |
+----------+--------------------------------------------------------+
| 2 bytes | A word that contains the point number of the node |
+----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the total number of __files__ |
| | you have sent to this node. |
+----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the total number of __bytes__ |
| | you have sent to this node. |
+----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the total number of __files__ |
| | you have received from this node. |
+----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the total number of __bytes__ |
| | you have received from this node. |
+----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the first date you received |
| | anything from this node or sent anything to this node. |
| | This is stored as days since Jan. 1, 1978 which is the |
| | same way AmigaDOS stores the date in datestamps. |
+----------+--------------------------------------------------------+
Structures for C programmers
============================
Here they are, ready to be used! These are the needed definitions for
uchar, uword and ulong:
typedef unsigned char uchar; /* must be 8 bits wide */
typedef unsigned short uword; /* must be 16 bits wide */
typedef unsigned long ulong; /* must be 32 bits wide */
struct Node4D
{
uword Zone,Net,Node,Point;
};
struct DiskAreaStats
{
uchar Tagname[80];
struct Node4D Aka;
uchar Group;
uchar fill_to_make_even; /* Just ignore this one */
ulong TotalFiles;
ulong TotalBytes;
ulong Last8DaysFiles[8];
ulong Last8DaysBytes[8];
struct DateStamp FirstTime;
ulong LastDay;
};
struct DiskNodeStats
{
struct Node4D Node;
ulong SentFiles;
ulong SentBytes;
ulong GotFiles;
ulong GotBytes;
ulong FirstDay;
};